MKVToolnix has been my go-to tool for muxing mkv video files for over a decade. There is one quirk with it that bothers me and I wonder if anyone can help me with it, or can suggest another tool that gets around it.
It's like this, take a video file that has an audio stream. Use mkvtoolnix to mux it into an mkv file and cut it into two pieces. Then, rejoin the two pieces, at the point where they were cut. You would assume you'd get the same video as the original, correct? Not quite.
Another tool I use frequently is Aegisub, for editing subtitles. Its video player is capable of show the timecode (timestamp?) of each frame of video that it is playing to the milisecond. When I use Aegisub to look at both the original and rejoined videos, there is a difference. Let's say the video was cut at frame 101. On the rejoined video, frame 101 could be 10 to 40+ miliseconds off compared to its original position.
This only happens when the video has an audio stream. If the video has no audio stream, there's no discrepancy on rejoining. Not more than 1 or 2 ms that I feel is caused by an unrelated matter anyway. So I'm sure the audio stream is the cause. Since I because aware of this quirk, I have avoided joining videos with audio streams together.
But today, I met a situation where I had to cut part of an audio stream and rejoin it to its original. When the task was complete, there was a displacement of 11 ms. A quarter of a frame at the framerate of the video, I considered that acceptable under the circumstances.
Still, I would like to know, is there a way to do better?
+ Reply to Thread
Results 1 to 6 of 6
-
-
maybe this is because you don't cut in a Key-frameOriginally Posted by Compositor
If the frame 101 is not a Key-frame the cut is made in the closest key-frame.Originally Posted by Compositor
.. did you apply a negative delay here?Originally Posted by Compositor責任者-MDX -
I do cut on key frames. Aegisub is also a good tool for locating keyframes to make cuts.
I did not, but stream info readers and stream extractors do indicate the audio stream has a delay within the video file. When cut, the cut segment also has an additional delay. I have no way of knowing if the delay should be there.... did you apply a negative delay here? -
See mkvmerge docs about --append-mode and keep in mind audio and video frames usually don't align perfectly.
Also note:
- mkvmerge cutting is not safe in regards to non-IDR seeking points.
- mkvmerge does not cut in the middle of a subtitle (at least for text subtitles)Last edited by sneaker; 22nd Mar 2020 at 04:51.
-
I don't suppose you know how to change the append mode without resorting to commandline?
I have imagined the audio track jutting out a bit at the cut point on both segments too.
What are IDR seeking points?- mkvmerge cutting is not safe in regards to non-IDR seeking points.
I've looked at subs where a text line straddled a cut. That line still contains the original end time for the line, which is now beyond the end of the video. If you joined another video to this one, the first frame of the next video segment would be after the end of that text line. An effect of the file-type append, I suppose.- mkvmerge does not cut in the middle of a subtitle (at least for text subtitles) -
Similar Threads
-
MKVToolnix Batch Merge Videos and Subtitles, Different Formats
By pumpysworld in forum Newbie / General discussionsReplies: 2Last Post: 25th Nov 2018, 22:16 -
Remuxing with MKVToolNix removes videos' thumbnails and file properties.
By nothingness in forum Newbie / General discussionsReplies: 4Last Post: 6th Aug 2018, 11:14 -
MKVToolNix - How do I join iPhone 8 Plus videos?
By EnochLight in forum Video ConversionReplies: 3Last Post: 23rd Jul 2018, 13:41 -
MKVtoolnix : adding an audio track results in warnings and corrupted audio
By Jose Hidalgo in forum EditingReplies: 10Last Post: 9th Mar 2018, 12:48 -
MKVToolnix reduces overall bitrate of videos
By temp22 in forum Video ConversionReplies: 5Last Post: 13th May 2016, 13:06


Quote
